<?php
 
namespace models\entities;
 
/**
 * @Entity(repositoryClass="models\repositories\UserRepository")
 * @Table(name="user")
 */
class User {
 
/**
 * @Id
 * @Column(name="user_id",type="string", length=45, unique=true, nullable=false)
 */
	protected $userId;
 
/**
 * @Column(type="string", length=45, nullable=false)
 */
	protected $password;
	
/**
 * @Column(name="create_date", type="integer", nullable=true)
 */
	protected $createDate;
 
/**
 * @Column(name="last_login", type="integer", nullable=true)
 */
	protected $lastLogin; 
 
/**
 * @Column(type="datetime", nullable=true)
 */
	protected $timestamp; 
 
 
	public function setUserId($userId)
	{
	    $this->userId = $userId;
	}
 
	public function getUserId()
	{
	    return $this->userId;
	}

	public function setPassword($password)
	{
	    $this->password = $password;
	}
 
	public function getPassword()
	{
	    return $this->password;
	}
	
	public function setTimestamp($timestamp)
    {
        // will NOT be saved in the database
        $this->timestamp = new \DateTime("now");
    }
    
	public function getTimestamp()
    {
        return $timestamp;
    }
	
	public function setCreateDate($createDate)
	{
	    $this->createDate = $createDate;
	}
 
	public function getCreateDate()
	{
	    return $this->createDate;
	}
	
	public function setLastLogin($lastLogin)
	{
	    $this->lastLogin = $lastLogin;
	}
 
	public function getLastLogin()
	{
	    return $this->lastLogin;
	}	
}